package cn.wolfcode.crm.service.imp;


import cn.wolfcode.crm.domain.DictionaryBill;

import cn.wolfcode.crm.mapper.DictionaryBillMapper;
import cn.wolfcode.crm.service.IDictionaryBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryBillServiceImpl implements IDictionaryBillService {
    @Autowired
    private DictionaryBillMapper dictionaryBillMapper;

    @Override
    public List<DictionaryBill> selectBySn(String sn) {
        List<DictionaryBill> dept = dictionaryBillMapper.selectBySn(sn);
        return dept;
    }

    @Override

    public void deleteByPrimaryKey(Long id) {
        if (id != null) {

            dictionaryBillMapper.deleteByPrimaryKey(id);
        }
    }

    @Override

    public void saveOrUpdate(DictionaryBill entity) {
        if (entity.getId() != null) {
            //更新操作
            dictionaryBillMapper.updateByPrimaryKey(entity);

        }else {

            dictionaryBillMapper.insert(entity);
        }

    }

    @Override
    public DictionaryBill selectByPrimaryKey(Long id) {

            DictionaryBill dept = dictionaryBillMapper.selectByPrimaryKey(id);
        return dept;

    }

    @Override
    public List<DictionaryBill> selectAll() {
        List<DictionaryBill> depts = dictionaryBillMapper.selectAll();
        return depts;
    }




}
